<template>
	<div v-loading="loading">
		<div class="title1">
			<div>
				<span class="h1">业务管理</span>
				<span class="h2">客户管理</span>
			</div>
		</div>

		<div class="con">
			<div>
				<el-button type="primary" @click="openMody()">+ 新建</el-button>
				<el-select v-model="value5" multiple placeholder="请选择项目" filterable>
					<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>
				<el-radio-group v-model="radio" size="small">
					<el-radio label="1">全部</el-radio>
					<el-radio label="2">只看公海</el-radio>
					<el-radio label="3">不看公海</el-radio>
				</el-radio-group>
				<el-checkbox v-model="checked">已成交</el-checkbox>
				<div style="float: right;">
					<div style="width: 240px; position: relative; display: inline-block;">
					<el-input v-model="input" placeholder="请输入..."></el-input>
					<!--<i class="el-icon-search"  style="position: absolute; width:40px;height:36px;right:0;top:0;color:#000;text-align:center;line-height:36px"></i>-->
					</div>
					<el-button type="primary" @click="check()">查看</el-button>
				</div>
				
			</div>
			<div class="tieme">
				<div class="time-content">
					<el-date-picker
				      v-model="starTime"
				      type="date"
				      placeholder="开始时间">
				    </el-date-picker>
				    <el-date-picker
				      v-model="endTime"
				      type="date"
				      placeholder="结束时间">
				    </el-date-picker>
					<el-button type="primary" @click="educe()">导出excel</el-button>
					</div>
				</div>
			<div style="margin-top: 10px;height:;overflow: auto;padding-bottom: 100px;">
				<el-table :data="tableData5" style="width: 100%">
					<el-table-column type="expand">
						<template slot-scope="props" >
							<el-tabs v-model="activeName1" @tab-click="handleClick">
							    <el-tab-pane label="自定义属性" name="first" inline class="demo-table-expand">
							    	<el-form >
										 <el-form-item :label="item.ExtendCaption" v-for="item in props.row.Extends" style="width:49%;float: left;margin-bottom: 20px;" :key="item.ExtendCaption">
											<span v-if="item.ExtendDataType != '4'">
												{{item.ExtendValue}} 
											</span>
											<span v-else>
												<el-select v-model="item.ExtendValue"  disabled multiple filterable placeholder="请选择" v-if="item.IsMulti">
													<el-option v-for="items in item.ExtendOptions" :key="items.ID" :label="items.CNName" :value="items.ID">
													</el-option>
												</el-select>
												<el-select v-model="item.ExtendValue"   disabled filterable placeholder="请选择" v-else="">
													<el-option v-for="items in item.ExtendOptions" :key="items.ID" :label="items.CNName" :value="items.ID">
													</el-option>
												</el-select>
											</span>
										</el-form-item>
									</el-form>
							    </el-tab-pane>
							    <el-tab-pane label="交易信息" name="second">
									<ul class="tranInfo">
										<li>
											<span>交易时间:</span><span>{{props.row.Trans_Time}}</span>
										</li>
										<li>
											<span>交易金额:</span><span>{{props.row.Trans_Money}}</span>
										</li>
										<li>
											<span>交易置业顾问:</span><span>{{props.row.Trans_Counselor}}</span>
										</li>
										<li>
											<span>交易房号:</span><span>{{props.row.Trans_HouseCode}}</span>
										</li>
										<li>
											<span>交易项目:</span>
											<span>
												<el-select v-model="props.row.Trans_ProjectID"  disabled placeholder="请选择">
													<el-option v-for="items in pros1" :key="items.value" :label="items.label" :value="items.value">
													</el-option>
												</el-select>
											</span>
										</li>
									</ul>
							    </el-tab-pane>
						   </el-tabs>
						</template>
					</el-table-column>
					<el-table-column label="姓名" prop="CNName">
					</el-table-column>
					<el-table-column label="电话" prop="Tel">
					</el-table-column>
					<el-table-column label="项目名称" prop="ProjectName">
					</el-table-column>
					<el-table-column label="所属业务员" prop="SalesName">
					</el-table-column>
					<el-table-column label="性别" prop="Gender">
					</el-table-column>
					<el-table-column label="职业" prop="ProfessionName">
					</el-table-column>
					<el-table-column label="居住区域" prop="DistrictName">
					</el-table-column>
					<el-table-column label="创建人" prop="CreateMan">
					</el-table-column>
					<el-table-column label="交易" prop="IsTrans">
						<template slot-scope="scope">
							<el-switch v-model="scope.row.IsTrans" @change="showjy(scope.row.ID,scope.row.IsTrans)" active-color="#13ce66" inactive-color="#ff4949">
							</el-switch>
						</template>
					</el-table-column>
					<el-table-column label="创建时间" prop="CreateDate">
					</el-table-column>
					<el-table-column label="操作">
						<template slot-scope="scope">
							<el-dropdown trigger="click">
								<span class="el-dropdown-link"><el-button type="primary">操作<i class="el-icon-arrow-down el-icon--right"></i></el-button></span>
								<el-dropdown-menu slot="dropdown">
									<el-dropdown-item>
										<el-button size="small"  type="primary" @click="modify(scope.row.ID)">修改</el-button>
									</el-dropdown-item>
									<el-dropdown-item>
										<el-button size="small" type="danger" @click.native.prevent="deleteRow(scope.row.ID)">删除</el-button>
									</el-dropdown-item>
									<el-dropdown-item>
										<el-button size="small"  type="success" @click="demand(scope.row.ID)">需求</el-button>
									</el-dropdown-item>
									<el-dropdown-item>
										<el-button size="small" type="warning" @click.native.prevent="admeasure(scope.row.ID)">分配</el-button>
									</el-dropdown-item>
									<el-dropdown-item>
										<el-button size="small" type="success" @click="setnosales(scope.row.ID)">放公海</el-button>
									</el-dropdown-item>
									<el-dropdown-item>
										<router-link v-bind="{to:'/salesMan/'+(scope.row.ID)}"><el-button size="small"  type="info">业务记录</el-button></router-link>
									</el-dropdown-item>
								</el-dropdown-menu>
							</el-dropdown>
						</template>
					</el-table-column>
				</el-table>
				<div style="float: right; margin-top: 10px;margin-right: 5px;">
					<el-pagination :current-page="pageindex" @current-change="handleCurrentChange" layout="prev, pager, next" :total="leng">
					</el-pagination>
				</div>
			</div>
		</div>
		<div class="edit" v-if="dialogVisible">
			<el-dialog title="新建客户" :visible.sync="dialogVisible" size="tiny">
				<el-form ref="form" :model="form" label-width="80px">
					<el-tabs v-model="activeName2" @tab-click="handleClick">
						<el-tab-pane label="基本信息" name="first">
							<el-form-item label="客户姓名">
								<el-input v-model="form.name"></el-input>
							</el-form-item>
							<el-form-item label="客户电话">
								<el-input v-model="form.tel"></el-input>
							</el-form-item>
							<el-form-item label="性别">
								<el-radio v-model="form.sex" label="1" border>男</el-radio>
								<el-radio v-model="form.sex" label="2" border>女</el-radio>
							</el-form-item>
							<el-form-item label="年龄">
								<el-input-number v-model="num8" controls-position="right" @change="handleChange" :min="1" :max="150"></el-input-number>
							</el-form-item>
							<el-form-item label="职业">
								<el-select v-model="voc" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in vocs" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="居住区域">
								<el-select v-model="address" placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in addressS" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="所属项目">
								<el-select v-model="pro" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in pros" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="业务员">
								<el-select v-model="Sale" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in Sales" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="需求" name="second">
							<el-form-item label="意向项目">
								<el-select v-model="ysxm" multiple placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in ysxms" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="住宅面积">
								<el-select v-model="zzmj" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in zzmjs" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="商业面积">
								<el-select v-model="symj" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in symjs" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="物业类型">
								<el-select v-model="needtype" multiple placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in needtypes" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="购买意图">
								<el-select v-model="gmyt" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in gmyts" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="交易" name="third">
							<el-form-item label="是否交易">
								<el-switch v-model="IsTrans" active-color="#13ce66" inactive-color="#ff4949">
								</el-switch>
							</el-form-item>
							<el-form-item label="时间">
								<el-date-picker v-model="dataT" type="date" placeholder="选择日期">
								</el-date-picker>
							</el-form-item>
							<el-form-item label="交 易金额">
								<el-input v-model="money"></el-input>
							</el-form-item>
							<el-form-item label="置业顾问">
								<el-input v-model="zygw"></el-input>
							</el-form-item>
							<el-form-item label="交易项目">
								<el-select v-model="jyxm" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in jyxms" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="交易房号">
								<el-input v-model="jyfh"></el-input>
							</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="其他信息" name="fourth">
							<el-form-item :label="item.FieldCaption" v-for="item in Dates" :key="item.FieldName">
								<el-date-picker v-model="item.Value" type="date" placeholder="选择日期">
								</el-date-picker>
							</el-form-item>
							<!--<el-form-item :label="item.FieldName" v-for="(item,index) in Strs" :key="item.Value">
								<el-input v-model="item.Value"></el-input>-->
							<!--</el-form-item>-->
							<div v-for="itemff in Strs" class="el-items"> 
								<label class="lables">{{itemff.FieldCaption}}</label>
								<input class="input exInput" value="">
							</div>
							<el-form-item :label="item.FieldCaption" v-for="item in numbers" :key="item.Value">
								<el-input-number v-model="item.Value" controls-position="right" @change="handleChange" :min="1" :max="100"></el-input-number>
							</el-form-item>
							<el-form-item :label="itemt.FieldCaption" v-for="itemt in items" :key="itemt.ValueID">
								<el-select v-model="itemt.Value" clearable filterable multiple placeholder="请选择" v-if="itemt.IsMulti">
									<el-option v-for="item in itemt.FieldOptions" :key="item.ID" :label="item.CNName" :value="item.ID">
									</el-option>
								</el-select>
								<el-select v-model="itemt.Value" clearable filterable  placeholder="请选择" v-else>
									<el-option v-for="item in itemt.FieldOptions" :key="item.ID" :label="item.CNName" :value="item.ID">
									</el-option>
								</el-select>
							</el-form-item>
						</el-tab-pane>
					</el-tabs>
				</el-form>
				<span slot="footer" class="dialog-footer">
					<el-button @click="quxiao()">取 消</el-button>
					<el-button type="primary" @click="addCus()">确 定</el-button>
				</span>
			</el-dialog>
		</div>

		<!--修改开始-->
		<div class="edit" v-if="xiugai">
			<el-dialog title="修改客户" :visible.sync="xiugai" size="tiny">
				<el-form ref="form" :model="form" label-width="80px">
					<el-tabs v-model="activeName" @tab-click="handleClick">
						<el-tab-pane label="需求" name="first">
							<el-form-item label="客户姓名">
						<el-input v-model="form.name"></el-input>
					</el-form-item>
					<el-form-item label="客户电话">
						<el-input v-model="form.tel"></el-input>
					</el-form-item>
					<el-form-item label="性别">
						<el-radio v-model="form.sex" label="1" border>男</el-radio>
						<el-radio v-model="form.sex" label="2" border>女</el-radio>
					</el-form-item>
					<el-form-item label="年龄">
						<el-input-number v-model="num8" controls-position="right" @change="handleChange" :min="1" :max="150"></el-input-number>
					</el-form-item>
					<el-form-item label="职业">
						<el-select v-model="voc" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in vocs" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="居住区域">
						<el-select v-model="address" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in addressS" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="所属项目">
						<el-select v-model="pro"  clearable filterable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in pros" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="业务员">
						<el-select v-model="Sale" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in Sales" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="需求" name="second">
							<el-form-item label="意向项目">
								<el-select v-model="ysxm" multiple placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in ysxms" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="住宅面积">
								<el-select v-model="zzmj" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in zzmjs" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="商业面积">
								<el-select v-model="symj" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in symjs" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="物业类型">
								<el-select v-model="needtype" multiple placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in needtypes" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="购买意图">
								<el-select v-model="gmyt" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in gmyts" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="交易" name="third">
							<el-form-item label="是否交易">
								<el-switch v-model="IsTrans" active-color="#13ce66" inactive-color="#ff4949">
								</el-switch>
							</el-form-item>
							<el-form-item label="时间">
								<el-date-picker v-model="dataT" type="date" placeholder="选择日期">
								</el-date-picker>
							</el-form-item>
							<el-form-item label="交 易金额">
								<el-input v-model="money"></el-input>
							</el-form-item>
							<el-form-item label="置业顾问">
								<el-input v-model="zygw"></el-input>
							</el-form-item>
							<el-form-item label="交易项目">
								<el-select v-model="jyxm" clearable placeholder="请选择" style="width: 100%;">
									<el-option v-for="item in jyxms" :key="item.value" :label="item.label" :value="item.value">
									</el-option>
								</el-select>
							</el-form-item>
							<el-form-item label="交易房号">
								<el-input v-model="jyfh"></el-input>
							</el-form-item>
						</el-tab-pane>
						<el-tab-pane label="其他信息" name="fourth">
							<el-form-item :label="item.FieldCaption" v-for="item in Dates" :key="item.FieldCaption">
								<el-date-picker v-model="item.Value" type="date" placeholder="选择日期">
								</el-date-picker>
							</el-form-item>
							<div v-for="itemff in Strs" class="el-items"> 
								<label class="lables">{{itemff.FieldCaption}}</label>
								<input class="input exInput" value="">
							</div>
							<el-form-item :label="item.FieldCaption" v-for="item in numbers" :key="item.Value">
								<el-input-number v-model="item.Value" controls-position="right" @change="handleChange" :min="1" :max="100"></el-input-number>
							</el-form-item>
							<el-form-item :label="itemt.FieldCaption" v-for="itemt in items" :key="itemt.ValueID">
								<el-select v-model="itemt.Value" clearable filterable multiple placeholder="请选择" v-if="itemt.IsMulti">
									<el-option v-for="item in itemt.FieldOptions" :key="item.ID" :label="item.CNName" :value="item.ID">
									</el-option>
								</el-select>
								<el-select v-model="itemt.Value" clearable filterable  placeholder="请选择" v-else>
									<el-option v-for="item in itemt.FieldOptions" :key="item.ID" :label="item.CNName" :value="item.ID">
									</el-option>
								</el-select>
							</el-form-item>
						</el-tab-pane>
					</el-tabs>
				</el-form>
				<span slot="footer" class="dialog-footer">
					<el-button @click="quxiao()">取 消</el-button>
					<el-button type="primary" @click="editCus()">确 定</el-button>
				</span>
			</el-dialog>
		</div>
		<!--修改结束-->
		<div class="edit" v-if="maskk">
			<el-dialog title="" :visible.sync="maskk" size="tiny" :before-close="handleClose1">
				<el-form ref="form1" :model="form1" label-width="80px">
					<el-form-item label="时间">
						<el-date-picker v-model="form1.dataT" type="date" placeholder="选择日期">
						</el-date-picker>
					</el-form-item>
					<el-form-item label="交 易金额">
						<el-input v-model="form1.money"></el-input>
					</el-form-item>
					<el-form-item label="置业顾问">
						<el-input v-model="form1.zygw"></el-input>
					</el-form-item>
					<el-form-item label="交易项目">
						<el-select v-model="form1.jyxm" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form1.jyxms" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="交易房号">
						<el-input v-model="form1.jyfh"></el-input>
					</el-form-item>
				</el-form>
				<span slot="footer" class="dialog-footer">
					<el-button @click="quxiao()">取 消</el-button>
					<el-button type="primary" @click="showmask()">确 定</el-button>
				</span>
			</el-dialog>
		</div>

		<div class="edit" v-if="need">
			<el-dialog title="" :visible.sync="need" size="tiny">
				<el-form ref="form2" :model="form2" label-width="80px" style="margin-top:20px">
					<el-form-item label="意向项目">
						<el-select v-model="form2.ysxm" multiple placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form2.ysxms" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="住宅面积">
						<el-select v-model="form2.zzmj" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form2.zzmjs" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="商业面积">
						<el-select v-model="form2.symj" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form2.symjs" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="物业类型">
						<el-select v-model="form2.needtype" multiple placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form2.needtypes" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="购买意图">
						<el-select v-model="form2.gmyt" clearable placeholder="请选择" style="width: 100%;">
							<el-option v-for="item in form2.gmyts" :key="item.value" :label="item.label" :value="item.value">
							</el-option>
						</el-select>
					</el-form-item>
				</el-form>
				<span slot="footer" class="dialog-footer">
					<el-button @click="quxiao1()">取 消</el-button>
					<el-button type="primary" @click="showmask1()">确 定</el-button>
				</span>
			</el-dialog>
		</div>

		<div class="edit" v-if="fenpei">
			<el-dialog title="分配业务员" :visible.sync="fenpei" width="30%">
				<el-select v-model="Said" clearable placeholder="请选择" style="width: 100%;margin-top:20px">
					<el-option v-for="item in SalesID" :key="item.value" :label="item.label" :value="item.value">
					</el-option>
				</el-select>
				<span slot="footer" class="dialog-footer">
			    <el-button @click="fenpei = false">取 消</el-button>
			    <el-button type="primary" @click="allot()">确 定</el-button>
			  </span>
			</el-dialog>
		</div>
	</div>
</template>

<script>
	import api from '../../kits/api.js';
	export default {
		name: 'client',
		data() {
			return {
				starTime:"",//开始时间
				endTime:"",//结束时间
				loading:true,
				SalesID: [],
				fenpei: false, //分配弹框
				xiugai: false, //修改弹框
				IsTrans: false, //是否交易
				datas: [], //存储数据数组
				numbers: [], //数字
				Strs: [], //字符
				Dates: [], //日期
				items: [], //列表
				leng: 1, //页码
				radio: "1",
				data: [],
				need: false,
				form2: {
					ysxm: [],
					ysxms: [],
					zzmj: "",
					zzmjs: [],
					symj: "",
					symjs: [],
					needtype: [],
					needtypes: [],
					gmyt: "",
					gmyts: [],
				},
				form1: {
					dataT: '',
					money: '',
					zygw: '',
					jyxm: "",
					jyxms: [],
					jyfh: "",
				},
				pros1:[],//项目
				maskk: false,
				jyfh: "",
				zygw: "",
				money: "",
				jyxm: "",//交易项目详情
				jyxms: [],//交易项目列表
				dataT: "",
				gmyts: [],//购买意图列表
				gmyt: "",//购买意图详情
				needtype: [],//需求详情
				needtypes: [],//需求列表
				symj: "",//商业面积详情
				symjs: [],//商业面积列表
				zzmj: "",//住宅面积详细
				zzmjs: [],//住在面积列表
				ysxm: [],//意向项目详情
				ysxms: [],//意向项目列表
//				radio: '1',//性别
				vocs: [],//职业列表
				voc: '',//职业详情
				address: "",//居住区域详情
				addressS: [], //居住区域
				Sale: "",//业务员详情
				Sales: [],//业务员列表
				pro: "",//所属项目详情
				pros: [], //所属项目
				checked: true,
				options: [],//项目选择
				value5: [],
				input: "",
				value2: "",
				form: {
					name: '',
					pass: '',
					tel: '',
					sex:"1"
				},
				showEdit: false, //显示编辑
				user: [{
					"username": "",
					"name": "",
					"password": "",
					"regpassword": "",
					"tel": "",
				}],
				currentRow: null,
				dialogVisible: false,
				msg: "",
				tableData5: [],
				activeName: 'first',
				activeName1: 'first',
				activeName2: 'first',
				num8: "1",
				Index: 0,
				ProjectID: "", //项目id
				SalerID: "", //销售员id
				Trans_ProjectID: "", //交易项目ID
				CreateMan: "", //创建人
				CreateDate: "", //创建时间
				Said: "",//分配业务id
				pageindex:1,//页码
			}
		},
		mounted: function() {
			this.cusList(this.pageindex)
			this.getProjectList1()
			this.getCales()
		},
		methods: {
			handleRow(index) {
				alert(index)
			},
			//是否成交
//			handleCheckAllChange(val) {
//				this.loading = true;
//				this.$axios.post(api.cusList, {
//					"Para": {
//						"ProjectIDs": [],
//						"ListType": 1,
//						"IsTrans": this.checked,
//						"KeyWord": ""
//					},
//					"PageSize": 10,
//					"PageIndex": 0,
//					"OrderbyString": ""
//				}).then((res) => {
//					if(res.data.isOK) {
//						this.loading = false;
//						this.tableData5 = res.data.data.Data
//						this.leng = res.data.data.Items || 1
//					} else {
//						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
//							this.$router.push({
//								path: '/login'
//							})
//						} else {
//							this.loading = false;
//							this.$message.error(res.data.msg);
//						}
//					}
//				});
//		    },
			toggleRowExpansion(){
			},
			handleChange(value) {
			},
			handleClick(tab, event) {
//				console.log(tab, event);
			},
			//分页
			handleCurrentChange(val) {
				this.loading = true
				this.pageindex = val
				console.log(val)
				this.cusList(this.pageindex)
			},
			handleClose(done) {
				this.$confirm('确认关闭？')
					.then(_ => {
						done();
					})
					.catch(_ => {});
			},
			handleClose1(done) {
				this.$confirm('确认关闭？')
					.then(_ => {
						done();
						this.tableData5[this.Index].val = false
					})
					.catch(_ => {});
			},
			//分配弹框
			admeasure(id) {
				var me = this
				me.id = id;
				this.$axios.get(api.cusGetmodel + '/' + this.id).then((res) => {
					if(res.data.isOK) {
						this.Said = res.data.data.SalerID
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.$message.error(res.data.msg);
						}
					}
				})
				me.fenpei = true
			},
			//导出excel
			educe(){
				var me = this
				me.$axios.post(api.exportexcel, {
				  "ProjectIDs": this.value5,
				  "ListType": this.radio,
				  "IsTrans": this.checked,
				  "SDate": this.starTime,
				  "EDate": this.endTime,
				  "KeyWord": this.input
				}).then((res) => {
					if(res.data.isOK) {
						var urls = res.data.data
						window.location.href = api.host+'/template/'+urls
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			//确定分配
			allot() {
				this.loading = true
				var me = this
				me.$axios.post(api.cusSetcstsales, {
					"CustomerID": this.id,
					"SalesID": this.Said,
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.fenpei = false
						this.pageindex = 1
						this.cusList(this.pageindex)
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.fenpei = false;
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			//修改弹框
			modify(id) {
				this.vocs=[]
				this.addressS=[]
				this.pros = []
				this.Sales=[]
				this.ysxms = []
				this.zzmjs=[]
				this.symjs=[]
				this.gmyts=[]
				this.needtypes=[]
				this.jyxms=[]
				this.getDemandType()//需求
				this.getdictjoblist() //获取职业列表
				this.getaddresslist() //居住区域列
				this.getProjectList()//项目列表
				this.getCales() //业务员列表
				this.getPurchase() //购买意图
				this.getResidence()//住宅面积
				this.getBusiness()//商业面积
				this.Strs = []
				this.numbers = []
				this.Dates = []
				this.items = []
				this.id = id
				this.datas=[]
				this.xiugai = true
				var me = this
				//通过id获取模型
				this.$axios.get(api.cusGetmodel + '/' + this.id).then((res) => {
					if(res.data.isOK) {
						this.form.name = res.data.data.CNName
						this.form.tel = res.data.data.Tel
						this.pro = res.data.data.ProjectID
						this.Sale = res.data.data.SalerID
						if(res.data.data.Gender =="男"){
							this.form.sex = "1"
						}else if(res.data.data.Gender=="女"){
							this.form.sex = "2"
						}
						this.num8 = res.data.data.Age
						this.voc = res.data.data.Profession
						this.address = res.data.data.FromDistrict
						this.CreateMan = res.data.data.CreateMan
						this.ysxm = JSON.parse(res.data.data.Demand_Project) || []
						this.zzmj = res.data.data.Demand_AreaH 
						this.symj = res.data.data.Demand_AreaB 
						this.needtype = JSON.parse(res.data.data.Demand_HouseType) || []
						this.gmyt = res.data.data.Demand_Purpose
						this.IsTrans = res.data.data.IsTrans
						this.dataT = res.data.data.Trans_Time
						this.money = res.data.data.Trans_Money
						this.zygw = res.data.data.Trans_Counselor
						this.jyxm = res.data.data.Trans_ProjectID
						this.jyfh = res.data.data.Trans_HouseCode
						this.datas = res.data.data.Extends
						for(var i = 0; i < this.datas.length; i++) {
							switch(this.datas[i].DataType) {
								case 1:
									me.Str=[]
									me.Strs.push(this.datas[i])
									setTimeout(function(){
										for(var j = 0;j<me.Strs.length;j++){
											$(".input").eq(j).val(me.Strs[j].Value)
										}
									},0)
									break;
								case 2:
									me.numbers=[]
									me.numbers.push(this.datas[i])
									break;
								case 3:
									me.Dates=[]
									me.Dates.push(this.datas[i])
									break;
								case 4:
									me.datas[i].Value = JSON.parse(me.datas[i].Value)||[]
									me.items.push(this.datas[i])
									break;
								default:
							}
						}
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.$message.error(res.data.msg);
						}
					}
				})
			},
			//确定修改
			editCus() {
				for(var i = 0;i<this.Strs.length;i++){
					this.Strs[i].Value = $(".input").eq(i).val()
				}
				if(this.form.sex == "1"){
					this.form.sex = "男"
				}else if(this.form.sex == "2"){
					this.form.sex = "女"
				}
				
				this.loading = true
				var me = this
				me.$axios.post(api.cusEdit, {
					"Extends": me.datas,
					"ID": this.id,
					"CNName": this.form.name,
					"Tel": this.form.tel,
					"ProjectID": this.pro,
					"SalerID": this.Sale,
					"Gender": this.form.sex,
					"Age": this.num8,
					"Profession": this.voc,
					"FromDistrict": this.address,
					"CreateMan": this.CreateMan,
					"CreateDate": this.CreateDate,
					"Demand_Project": JSON.stringify(this.ysxm),
					"Demand_AreaH": this.zzmj,
					"Demand_AreaB": this.symj,
					"Demand_HouseType": JSON.stringify(this.needtype),
					"Demand_Purpose": this.gmyt,
					"IsTrans": this.IsTrans,
					"Trans_Time": this.dataT,
					"Trans_Money": this.money,
					"Trans_Counselor": this.zygw,
					"Trans_ProjectID": this.jyxm,
					"Trans_HouseCode": this.jyfh,
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.cusList(this.pageindex)
						this.checked = true
						this.xiugai= false;
						this.need = false;
						this.$message({
							message: '修改成功',
							type: 'success'
						});
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.need = false;
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			shows(index) {
				this.maskk = true;
				this.Index = index
			},
			//设置交易弹框
			showjy(id,isfalse) {
				if(isfalse){
					this.form1.jyxm=""
					this.form1.jyxms=[]
					this.getProjectList()//项目列表
					this.id = id
					this.maskk = true;
				}else{
					return;
				}
				
			},
			//设置交易
			showmask() {
				this.loading = true
				var me = this
				me.$axios.post(api.cusSettrans, {
					"CustomerID": this.id,
					"Trans_Time": this.form1.dataT,
					"Trans_Money": this.form1.money,
					"Trans_Counselor": this.form1.zygw,
					"ProjectID": this.form1.jyxm,
					"Trans_HouseCode": this.form1.jyfh
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.maskk = false;
						this.cusList(this.pageindex)
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.maskk = false;
							this.$message.error(res.data.msg);
						}
					}
				});

			},
//			quxiao() {
//				this.maskk = false;
//				this.tableData5[this.Index].val = false
//			},
			demand(id) {
				this.form2.ysxms=[]
				this.form2.symjs=[]
				this.form2.gmyts=[]
				this.form2.zzmjs=[]
				this.form2.needtypes=[]
				this.form2.ysxm=""
				this.form2.symj=""
				this.form2.gmyt=""
				this.form2.zzmj=""
				this.form2.needtype=""
				this.id = id
				this.getdictjoblist() //获取职业列表
				this.getaddresslist() //居住区域列
				this.getProjectList()//项目列表
//				this.getCales() //业务员列表
				this.getDemandType() //需求类型
				this.getPurchase() //购买意图
				this.getResidence()//住宅面积
				this.getBusiness()//商业面积
				this.need = true
			},
			quxiao1() {
				this.need = false;
			},
			//设置客户需求信息
			showmask1() {
				this.loading = true
				var me = this
				me.$axios.post(api.cusDemand, {
					"CustomerID": this.id,
					"Demand_Project": this.form2.ysxm,
					"Demand_AreaH": this.form2.zzmj,
					"Demand_AreaB": this.form2.symj,
					"Demand_HouseType": this.form2.needtype,
					"Demand_Purpose": this.form2.gmyt
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.need = false;
						this.cusList(this.pageindex)
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.need = false;
							this.$message.error(res.data.msg);
						}
					}
				});

			},
//			add() {
//				this.msg = this.input;
//				console.log(1)
//			},
			//获取客户列表
			cusList(val) {
				this.loading = true
				var me = this
				me.$axios.post(api.cusList, {
					"Para": {
						"ProjectIDs": this.value5,
						"ListType": this.radio,
						"IsTrans": this.checked,
						"KeyWord": this.input
					},
					"PageSize": 10,
					"PageIndex": val-1,
					"OrderbyString": ""
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.tableData5 = res.data.data.Data
						for(var i=0;i<this.tableData5.length;i++){
							for(var k =0;k<this.tableData5[i].Extends.length;k++){
								if(this.tableData5[i].Extends[k].ExtendDataType==4){
									if(this.tableData5[i].Extends[k].IsMulti){
								   		this.tableData5[i].Extends[k].ExtendValue = JSON.parse(this.tableData5[i].Extends[k].ExtendValue)
								    }else{
								    	this.tableData5[i].Extends[k].ExtendValue = this.tableData5[i].Extends[k].ExtendValue == null ? this.tableData5[i].Extends[k].ExtendValue:parseInt(this.tableData5[i].Extends[k].ExtendValue)
								    }
								}
							}
						}
						this.leng = res.data.data.Items
						this.getProjectList2()
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			//将客户放入公海
			setnosales(id) {
				this.loading = true
				var me = this
				me.$axios.get(api.cusSetnosales + '/' + id).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.cusList(this.pageindex) 
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			
			//删除客户
			deleteRow(id) {
				this.loading
				var me = this
				me.$axios.get(api.cusDel + '/' + id).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.cusList(this.pageindex)
						this.$message({
							message: '删除成功',
							type: 'success'
						});
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.$message.error(res.data.msg);
						}
					}
				});
			},

			//获取客户拓展
			extendsbytype() {
				var me = this
				me.$axios.post(api.extendsbytype, {
					ExtendType: 2,
					BusinessID: "",
				}).then((res) => {
					if(res.data.isOK) {
						this.datas = res.data.data
						for(var i = 0; i < res.data.data.length; i++) {
							switch(res.data.data[i].DataType) {
								case 1:
									me.Strs.push(res.data.data[i])
									break;
								case 2:
									me.numbers.push(res.data.data[i])
									break;
								case 3:
									me.Dates.push(res.data.data[i])
									break;
								case 4:
									me.datas[i].Value = JSON.parse(me.datas[i].Value)||[]
									me.items.push(res.data.data[i])
									break;
								default:
							}
						}
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.$message.error(res.data.msg);
						}
					}
				});
			},
			//新建弹框
			openMody() {
				this.jyfh=""
				this.money=""
				this.zygw=""
				this.jyxm=""
				this.dataT=""
				this.IsTrans=false
				this.form.name=""
				this.form.tel=""
				this.form.sex="1"
				this.num8=1
				this.vocs=[]
				this.addressS=[]
				this.pros = []
				this.Sales=[]
				this.ysxms = []
				this.zzmjs=[]
				this.symjs=[]
				this.gmyts=[]
				this.needtypes=[]
				this.jyxms=[]
				this.voc=[]
				this.address=[]
				this.zzmj=[]
				this.symj=[]
				this.needtype=[]
				this.gmyt=[]
				this.pro=[]
				this.ysxm=[]
				this.jyxm=[]
				this.Sale=[]
				this.Strs = []
				this.numbers = []
				this.Dates = []
				this.items = []
				this.extendsbytype() //获取拓展
				this.getdictjoblist() //获取职业列表
				this.getaddresslist() //居住区域列
				this.getProjectList()//项目列表
				this.getCales() //业务员列表
				this.getDemandType() //需求类型
				this.getPurchase() //购买意图
				this.getResidence()//住宅面积
				this.getBusiness()//商业面积
				this.dialogVisible = true
			},
			//取消
			quxiao() {
				this.xiugai= false;
				this.Strs = []
				this.numbers = []
				this.Dates = []
				this.items = []
				this.maskk= false
				this.dialogVisible = false
			},
			//新建客户
			addCus() {
				for(var i = 0;i<this.Strs.length;i++){
					this.Strs[i].Value = $(".input").eq(i).val()
				}
				this.loading = true
				if(this.form.sex == "1"){
					this.form.sex = "男"
				}else if(this.form.sex == "2"){
					this.form.sex = "女"
				}
				var me = this
				for(var i = 0; i < me.datas.length; i++) {
					switch(this.datas[i].DataType) {
						case 1:
							me.datas[i] = me.Strs[0]
							me.Strs.splice(0, 1)
							break;
						case 2:
							me.datas[i] = me.numbers[0]
							me.numbers.splice(0, 1)
							break;
						case 3:
							me.datas[i] = me.Dates[0]
							me.Dates.splice(0, 1)
							break;
						case 4:
							me.datas[i] = me.items[0]
							me.items.splice(0, 1)
							break;
						default:
					}
				}
				me.$axios.post(api.cusAdd, {
					"Extends": me.datas,
					"ID": "",
					"CNName": this.form.name,
					"Tel": this.form.tel,
					"ProjectID": this.pro,
					"SalerID": this.Sale,
					"Gender": this.form.sex,
					"Age": this.num8,
					"Profession": this.voc,
					"FromDistrict": this.address,
					"CreateMan": "",
					"CreateDate": "",
					"Demand_Project": JSON.stringify(this.ysxm),
					"Demand_AreaH": this.zzmj,
					"Demand_AreaB": this.symj,
					"Demand_HouseType": JSON.stringify(this.needtype),
					"Demand_Purpose": this.gmyt,
					"IsTrans": this.IsTrans,
					"Trans_Time": this.dataT,
					"Trans_Money": this.money,
					"Trans_Counselor": this.zygw,
					"Trans_ProjectID": this.jyxm,
					"Trans_HouseCode": this.jyfh,
				}).then((res) => {
					if(res.data.isOK) {
						this.loading = false
						this.pageindex = 1
						this.cusList(this.pageindex)
						this.quxiao()
						this.$message({
							message: '新建成功',
							type: 'success'
						});
					}else{
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
							this.$router.push({
								path: '/login'
							})
						} else {
							this.loading = false
							this.$message.error(res.data.msg);
							this.quxiao()
						}
						
					}
				});
			},
			//获取职业列表，词典1
			getdictjoblist() {
				var me = this;
				this.$axios.get(api.dictlist + '/1').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
									this.vocs.push({
										value:res.data.data[i].ID,
										label:res.data.data[i].DictName,
									})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
					.catch(function(error) {
						me.$message.error("数据拉去失败");
					});
			},
			//获取居住区域列表，词典2
			getaddresslist() {
				var me = this;
				this.$axios.get(api.dictlist + '/2').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
								this.addressS.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
			},
			//住宅面积
			getResidence() {
				var me = this;
				this.$axios.get(api.dictlist + '/3').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
								this.zzmjs.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
								this.form2.zzmjs.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
			},
			//商业面积
			getBusiness() {
				var me = this;
				this.$axios.get(api.dictlist + '/4').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
                                this.symjs.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
                                this.form2.symjs.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
			},
			//需求类型
			getDemandType() {
				var me = this;
				this.$axios.get(api.dictlist + '/6').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
								this.needtypes.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
								this.form2.needtypes.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
			},
			//购买意图
			getPurchase() {
				var me = this;
				this.$axios.get(api.dictlist + '/5').then(res => {
						if(res.data.isOK) {
							for(var i = 0; i < res.data.data.length; i++) {
								this.gmyts.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
//								this.form.gmyts.push({
//									value:res.data.data[i].ID,
//									label:res.data.data[i].DictName,
//								})
								this.form2.gmyts.push({
									value:res.data.data[i].ID,
									label:res.data.data[i].DictName,
								})
							}
						} else {
							if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
						}
					})
			},
			//获取项目1options
			getProjectList1(){
		        var me=this;
		        this.$axios.post(api.prolist, {
		            "Para": "",
		            "PageSize": 10000,
		            "PageIndex": 0,
		            "OrderbyString": ""
		        }).then(res => {
		            if (res.data.isOK) {
		                for(var i=0;i<res.data.data.Data.length;i++){
		                   this.options.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                }
		            } else {
		                if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
		            }
		        })
		    },
		    
		    //点击查看项目
		    check(){
		    	var me = this
		    	this.pageindex = 1
				me.$axios.post(api.cusList, {
					"Para": {
						"ProjectIDs": this.value5,
						"ListType": this.radio,
						"IsTrans": this.checked,
						"KeyWord": this.input
					},
					"PageSize": 10,
					"PageIndex": 0,
					"OrderbyString": ""
				}).then((res) => {
					if(res.data.isOK) {
						this.tableData5 = res.data.data.Data
						this.leng = res.data.data.Items
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
					}
				});
		    },
//		    //过滤查看
//		    look(){
//		    	var me = this
//				me.$axios.post(api.cusList, {
//					"Para": {
//						"ProjectIDs": [],
//						"ListType": 1,
//						"IsTrans": true,
//						"KeyWord": 
//					},
//					"PageSize": 10,
//					"PageIndex": 0,
//					"OrderbyString": ""
//				}).then((res) => {
//					if(res.data.isOK) {
//						this.tableData5 = res.data.data.Data
//						this.leng = res.data.data.Items
//					} else {
//						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
//								this.$router.push({
//									path: '/login'
//								})
//							} else {
//	
//								this.$message.error(res.data.msg);
//							}
//					}
//				});
//		    },
			//获取项目
			getProjectList(){
		        var me=this;
		        this.$axios.post(api.prolist, {
		            "Para": "",
		            "PageSize": 10000,
		            "PageIndex": 0,
		            "OrderbyString": ""
		        }).then(res => {
		            if (res.data.isOK) {
		                for(var i=0;i<res.data.data.Data.length;i++){
		                   this.pros.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                   this.ysxms.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                   this.jyxms.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                   this.form1.jyxms.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                   this.form2.ysxms.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                }
		            } else {
		                if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
		            }
		        })
		    },
		    //获取项目
			getProjectList2(){
		        var me=this;
		        this.$axios.post(api.prolist, {
		            "Para": "",
		            "PageSize": 10000,
		            "PageIndex": 0,
		            "OrderbyString": ""
		        }).then(res => {
		            if (res.data.isOK) {
		                for(var i=0;i<res.data.data.Data.length;i++){
		                   this.pros1.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].PName,
		                   })
		                }
		            } else {
		                if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
		            }
		        })
		    },
			//获取业务员列表
			getCales(){
		        var me = this
				me.$axios.post(api.salesgetlist, {
					"Para": {
						"ParendID": "",
						"Key": ""
					},
					"PageSize": 10000,
					"PageIndex": 0,
					"OrderbyString": "CNName"
				}).then((res) => {
					if(res.data.isOK) {
						 for(var i=0;i<res.data.data.Data.length;i++){
		                   this.Sales.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].CNName,
		                   })
		                   this.SalesID.push({
		                   		value:res.data.data.Data[i].ID,
								label:res.data.data.Data[i].CNName,
		                   })
		                }
					} else {
						if(res.data.msg == "Token无效" || res.data.msg == "Token缺失") {
								this.$router.push({
									path: '/login'
								})
							} else {
	
								this.$message.error(res.data.msg);
							}
					}
				});
		
		    },

		}
	}
</script>

<style>
	.title1 {
		width: 100%;
		padding: 15px 0;
		text-indent: 20px;
		background: #fff;
		border-bottom: 1px solid #dddee1;
	}
	
	.title1 span {
		margin-right: 10px;
	}
	
	.title1 .h1 {
		font-size: 16px;
		font-weight: 600;
	}
	
	.title1 .h2 {
		font-size: 14px;
	}
	
	.con {
		width: 100%;
		margin-top: 10px;
	}
	
	.page {
		float: right;
		margin-top: 20px;
	}
	
	.sigma-content {
		margin: 15px 0;
		text-align: center;
		background-color: #fff;
	}
	
	.sigma-middle-line:before {
		content: '';
		display: block;
		height: 1px;
		width: 100%;
		background-color: #999;
		/*颜色需与主题大背景色一致*/
		position: relative;
		top: 10px;
		/*调节线高*/
		left: 0;
	}
	
	.sigma-line-text {
		display: inline-block;
		background: #fff;
		padding: 0 18px 0 18px;
		position: relative;
		font-size: 14px;
		font-weight: 500;
	}
	
	.el-dialog__body {
		padding: 0 20px;
	}
	
	.el-form-item {
		margin-bottom: 10px;
	}
	
	.el-dialog {
		/*top:50% !important;*/
		transform: translate(-50%, -50%);
	}
	
	.edit {
		z-index: 9;
	}
	.tranInfo li{
		float: left;
		width: 50%;
		line-height: 36px;
		list-style: none;
	}
	.el-dropdown-menu__item {
		text-align: center;
	}
	
	.el-dropdown-menu {
		min-width: 79px !important;
	}
	.edit{
		position: fixed;
		background: rgba(0, 0, 0, .5);
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
	}
	.lables{
		display: inline-block;
		width: 80px;
		text-align: right;
    vertical-align: middle;
    float: left;
    font-size: 14px;
    color: #48576a;
    line-height: 1;
    padding: 11px 12px 11px 0;
    box-sizing: border-box;
	}
	.el-items{
		/*height: 36px;*/
		line-height: 36px;
		margin-bottom: 10px;
	}
	.exInput{
	background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #bfcbd9;
    box-sizing: border-box;
    color: #1f2d3d;
    font-size: inherit;
    height: 36px;
    line-height: 1;
    outline: 0;
    padding: 3px 10px;
    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
    }
    .exInput:focus{
    	border-color:#20a0ff;
    }
    .sel{
		width: 100%;
			background-color: #fff;
    background-image: none;
    border-radius: 4px;
    border: 1px solid #bfcbd9;
    box-sizing: border-box;
    color: #1f2d3d;
    font-size: inherit;
    height: 36px;
    line-height: 1;
    outline: 0;
    padding: 3px 10px;
    transition: border-color .2s cubic-bezier(.645,.045,.355,1);
	}
	.demo-table-expand {
   font-size: 0;
}
.demo-table-expand label {
    width: 90px;
    color: #99a9bf;
}
.demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 50%;
}
.el-items:after{
		display: block;
		clear: both;
		content: "";
		visibility: hidden;
		height: 0
}
.tieme {
    display: block;
    margin-top: 10px;
    text-align: right;
}
.time-content{
	display: inline-block;
}
.tieme .el-date-editor.el-input {
    width: 150px;
}
.demo-table-expand label{
	min-width: 60px;
	text-align: left;
}
</style>